package com.lxw.consumer;

import com.lxw.MqConst;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MqConsumer  {

    @RabbitListener(queues = MqConst.TEST_QUEUEQ)
    @RabbitHandler
    public void process(String msg){
        System.out.println(msg);
    }


    @RabbitListener(queues = MqConst.FANOUT1)
    @RabbitHandler
    public void process2(String msg){
        System.out.println("FANOUT1收到"+msg);
    }

    @RabbitListener(queues = MqConst.FANOUT2)
    @RabbitHandler
    public void process3(String msg){
        System.out.println("FANOUT2收到"+msg);
    }

    @RabbitListener(queues = MqConst.DIRECT_ERR)
    @RabbitHandler
    public void process4(String msg){
        System.out.println(msg);
    }


    @RabbitListener(queues = MqConst.TOP_ERROR)
    @RabbitHandler
    public void process5(String msg){
        System.out.println(msg);
    }
}
